﻿@typeparam TItem
@inherits EditPageBase<TItem>

<div class="card">
    <div class="card-header">
        查询结果
    </div>
    <div class="card-body">
        @TableInfoTemplate
        <Table @ref="Table" Id="@Id" FixedHeader="@FixedHeader" ShowToolBar="true" ShowExtendButtons="true" ShowRefresh="true" ShowSearch="true" ShowCheckbox="true" ShowDefaultButtons="true" QueryModel="QueryModel" TItem="TItem" SubmitModalTitle="@SubmitModalTitle" OnQuery="QueryData" OnAdd="OnAdd" OnDelete="OnDelete" OnSave="OnSave" OnResetSearch="OnResetSearch">
            <TableToolbarTemplate>
                @TableToolbarTemplate
            </TableToolbarTemplate>
            <TableHeader>
                @TableHeader?.Invoke(context)
            </TableHeader>
            <RowTemplate>
                @RowTemplate?.Invoke(context)
            </RowTemplate>
            <ButtonTemplate>
                <div class='btn-group'>
                    <button class='btn btn-sm btn-success' asp-auth="edit" @onclick="e => Edit(context)"><i class='fa fa-edit'></i><span>编辑</span></button>
                    <button class='btn btn-sm btn-danger' asp-auth="del" @onclick="e => Delete(context)"><i class='fa fa-remove'></i><span>删除</span></button>
                    @ButtonTemplate
                </div>
            </ButtonTemplate>
            <EditTemplate>
                @EditTemplate?.Invoke(context)
            </EditTemplate>
            <SearchTemplate>
                @QueryBody?.Invoke(context)
            </SearchTemplate>
        </Table>
    </div>
</div>
